#ifndef ___DMA_H___
#define ___DMA_H___

#include "stm32f10x.h"
#include "RAM.h"
//DMA2的配置
#define	DMA2_CHANNEL			DMA2_Channel1
#define	DMA2_CHANNEL_IRQn		DMA2_Channel1_IRQn
#define	DMA2_PERIPH_ADDR		(uint32_t)(&(SPI3->DR))
#define	DMA2_MEM_ADDR			(RAM_GetDataBufAddr())
#define	DMA2_DIRECTION			DMA_DIR_PeripheralSRC		//SPI3到DMA2
#define	DMA2_MODE				DMA_Mode_Circular			//DMA2的模式为循环模式
#define	DMA2_BUFSIZE			4000						//DMA2 触发中断的数据量4000byte


//DMA1的配置
#define	DMA1_CHANNEL			DMA1_Channel5
#define	DMA1_CHANNEL_IRQn		DMA1_Channel5_IRQn
#define	DMA1_PERIPH_ADDR		(uint32_t)(&(SPI2->DR))
#define	DMA1_MEM_ADDR			(RAM_GetDataBufAddr())
#define	DMA1_DIRECTION			DMA_DIR_PeripheralDST		//DMA1 将数据传到SPI2
#define	DMA1_MODE				DMA_Mode_Normal			    //DMA1的模式为普通模式
#define	DMA1_BUFSIZE			2000						//DMA2 触发中断的数据量4000byte

//函数声明
extern void DMA2_Configuration(void);
extern void DMA1_Configuration(void);
extern void DMA_CleanRcvDataLenth(void);
extern uint32_t DMA_GetRcvDataLenth(void);
#endif
